/*
package com.chrray.position.filter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.HashMap;
import java.util.Map;

*/
/**
 * @anthor ch
 * @description
 * @date
 *//*

@Configuration
public class XssFilterConfig {

    @Value("${excludeUrls}")
    private String excludeUrls;
    @Value("${filter.on}")
    private String filterOn;

    @Bean
    public FilterRegistrationBean<XssFilter> xssFilterRegistrationBean() {
        FilterRegistrationBean<XssFilter> registration = new FilterRegistrationBean<>();
//        registration.setDispatcherTypes(DispatcherType.REQUEST);
        registration.setFilter(new XssFilter());
        registration.addUrlPatterns("/*");
        registration.setName("XssFilter");
        registration.setOrder(Integer.MAX_VALUE);
        Map<String, String> initParameters = new HashMap<String, String>();
        initParameters.put("excludes",  "/favicon.ico,/img/*,/js/*,/css/*,/user/**");
        initParameters.put("enabled", filterOn);
        //放行url
        initParameters.put("excludeUrls", excludeUrls);
        registration.setInitParameters(initParameters);
        return registration;
    }
}
*/
